<?php 
	/*
		登陆了，就判断什么类型
	*/
	
	require_once("../../system/IMAP_class.php");
	$username='kanguo56@163.com';
	$pass='a123456';
	//判断用户
/*	echo preg_match('/(.*)@163.com/',trim("popjujst@163.com"),$match);
	var_dump($match);*/
	
	if( preg_match('/(.*)@163.com/',trim($username),$match)>0){
		$im=new IMAP("{imap.163.com:993/imap/ssl}INBOX",$username,$pass,$type=1);
		
	}elseif( preg_match('/(.*)@126.com/',trim($username),$match)>0){		
		$im=new IMAP("{imap.126.com:993/imap/ssl}INBOX",$username,$pass,$type=2);
		
	}elseif( preg_match('/(.*)@qq.com/',trim($username),$match)>0){
		$im=new IMAP("{imap.qq.com:993/imap/ssl}INBOX",$username,$pass,$type=3);
		
	}elseif( preg_match('/(.*)@gmail.com/',trim($username),$match)>0){
		$im=new IMAP("{imap.gmail.com:993/imap/ssl}INBOX",$username,$pass,$type=4);
		
	}elseif(  preg_match('/(.*)@yahoo.com/',trim($username),$match)>0){	
		$im=new IMAP("{imap.yahoo.com:993/imap/ssl}INBOX",$username,$pass,$type=5);
		
	}elseif( preg_match('/(.*)@souhu.com/',trim($username),$match)>0){
		$im=new IMAP("{imap.souhu.com:993/imap/ssl}INBOX",$username,$pass,$type=6);
	
	}elseif( preg_match('/(.*)@sina.com.cn/',trim($username),$match)>0){
		$im=new IMAP("{imap.sina.com.cn:993/imap/ssl}INBOX",$username,$pass,$type=7);
	}else{
		echo '跳出';
	}
?>